<?php

// Get variables
$limit      = get_input('limit');
$offset     = get_input('offset');
$userid     = get_input('user_id');

if ($userid == 'me') {
    $userid = get_loggedin_userid();
}

// get all interests rated by the current user
$ratings = get_interest_ratings_of($userid);

$return = array();
foreach($ratings as $rating) {
    $return[] = to_rating_array_with_user_object($rating);
}

echo json_encode(export_result(200, $return));
?>